package com.obas.access.business.service.impl;

import com.ease.common.vo.MapParameter;
import com.ease.platform.access.service.impl.AbstractParameterizedBeanIbatisAccessServiceImpl;
import com.obas.access.business.service.DeviceAccessService;
import com.obas.model.business.Device;
import com.obas.model.metadata.constant.EntityTypeConst;

public class DeviceAccessServiceImpl extends AbstractParameterizedBeanIbatisAccessServiceImpl<Device> implements DeviceAccessService {

	public Device findByCode(String code) {
		MapParameter parameter = new MapParameter();
		parameter.put(Device.Attribute_code, code);

		return this.findOne(parameter);
	}

	public Device findBrasByIpAddress(String ipAddress) {
		MapParameter parameter = new MapParameter();
		parameter.put(Device.ATTRIBUTE_entityTypeId, EntityTypeConst.BRAS.getId());
		parameter.put(Device.Attribute_ipAddress, ipAddress);
		
		return this.findOne(parameter);
	}

}
